package com.yangweiye.communicationonline;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * @author Lete
 * @乐特的程序永无BUG
 * @createDate 2020- 07-04 22:13
 *
 * 1. SendThread 发送消息线程
 * 2. RecieveThread 接受消息线程
 */
public class Client {
    public static void main(String[] args) {

        try {
            // 创建8888端口
            Socket s = new Socket("127.0.0.1", 8888);

            // 启动发送消息线程
            new SendThread(s).start();
            // 启动接受消息线程
            new RecieveThread(s).start();

        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
